Xbasic

INDEX.DROP Function

Syntax

V Drop()

Description

Drop the index from its table.

Discussion

The .DROP() method deletes the index, or query list, referenced by the object pointer. If references an index tag, the index is marked as deleted in the index file. If references a query list, the corresponding query list file ($$*.MPX) is deleted from disk. Dropping an index from an index file does not reduce the size of the index file ( tablename.cdx ). To compact the size of the index file, you must either rebuild the entire index file in Xbasic (using the TABLE.INDEX_CREATE_BEGIN(), <TBL>.INDEX_GET(), and <TBL>.INDEX_CREATE_END() methods), or interactively, by right clicking on a table in the Control Panel and selecting the Define Indexes command.

Example

This script drops the LASTNAME index.

dim tbl as P
dim indx as P
tbl = table.current()
indx = tbl.index_get("LASTNAME")
indx.drop()

See Also